#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;

class Solution 
{
public:
    bool isPalindrome(string s)
    {
        string r;
        for (char w : s)
        {
            if (isalnum(w))
            {
                r += tolower(w);
            }
        }
        int pos = 0, posprev = r.size() - 1;
        while (pos <= posprev)
        {
            if (r[pos] != r[posprev])
            {
                return false;
            }
            pos++;
            posprev--;
        }
        return true;
    }
};

int main()
{
    string s;
    Solution d;
    getline(cin,s);
    cout << d.isPalindrome(s)<<endl;
    return 0;
}